package biz.datalk.industrialland.admin.config;

import biz.datalk.industrialland.admin.component.upload.CustomUploadServiceImpl;
import biz.datalk.industrialland.common.util.RedisUtil;
import biz.datalk.upload.autoconfigure.properties.UploadProperties;
import biz.datalk.upload.service.IUploadService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.mail.javamail.ConfigurableMimeFileTypeMap;

/**
 * @author tarofang@163.com
 * @date 2024-01-19
 */
@Configuration
public class CustomUploadConfig {

    @Bean("uploadService")
    public IUploadService uploadService(
            UploadProperties uploadProperties, //
            RedisUtil redisUtil, //
            ConfigurableMimeFileTypeMap customConfigurableMimeFileTypeMap) {
        return new CustomUploadServiceImpl(uploadProperties, customConfigurableMimeFileTypeMap, redisUtil);
    }
}
